package com.testcolision.simulation;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;

public class Simulation {

	public Vehicle car;
	public Camera3D camera;

	// vehicle controls
	public float steering = 0; // -1 is left, 0 is center, 1 is right
	public float throttle = 0; // 0 is coasting, 1 is full throttle
	public float brakes = 0; // 0 is no brakes, 1 is full brakes

	public Simulation() {
		car = new Vehicle();
		car.SetLocation(new Vector2(0, 0), 0);
		car.Setup(new Vector2(3,8).mul(0.5f), 5);
	}

	public void update(float delta) {

		if (delta > 1)
			delta = 0.01f;

		car.SetSteering(steering);
		car.SetThrottle(throttle, false);
		car.SetBrakes(brakes);
		
		// car.AddForce(new Vector2(0, 0), new Vector2(0, 0));
		car.Update(delta);

	}
}
